# for while
good_list = ['康师傅方便面', '酸奶', '雪糕', '康师傅方便面', 18, 8.88, [1, 2, 3]]

# for
for name in good_list:
    print(name)
print('*' * 50)

# while
num = len(good_list)
i = 0
while i < num:
    print(good_list[i])
    i = i + 1
print('*' * 50)

# 嵌套循环
good_list1 = ['康师傅方便面', '酸奶', '雪糕', '康师傅方便面']
good_list2 = ['啤酒', '饮料', '矿泉水']
good_list3 = ['花生', '瓜子', '火腿肠']
good_list4 = [good_list1, good_list2, good_list3]
for item in good_list4:
    print(item)
    for name in item:
        print(name)
print('*' * 50)

# 遍历获取下标
for i,value in enumerate(good_list):
    print(i,value)




